package bs.app.android;

public class RecordEnumeration {

	private RecordStore rs = null;
	private int index = 0;
	private int iReal = 0;
	
	public RecordEnumeration(RecordStore r) {
		rs = r;
	}
	
	public boolean hasNextElement() {
		return (iReal < rs.getNumRecords());
	}

	public byte[] nextRecord() {
		index++;
		byte[] arr = rs.getRecord(index);
//		if(arr==null)
//			//System.out.println("-- NULL roi ->"+index);
//		else
//			//System.out.println("-- index="+index+" len="+arr.length);
		while(arr == null && index < rs.getRecordIdEnd()){
			index++;
			arr = rs.getRecord(index);
		}
		if(arr != null)
			iReal++;
		return arr;
	}

}
